home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1998 November: Tool Chest / Dev.CD Nov 98 TC.toast / Sample Code / Toolbox / Live Scroll 1.0 / Sources / ScrollBars.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-05-13  |  1.4 KB  |  80 lines  |  [TEXT/CWIE]

  1. /*
  2.     File:        ScrollBars.h
  3.  
  4.     Contains:    Header for scroll bars live scrolling implementation.
  5.  
  6.     Written by:    Chris White, Developer Technical Support
  7.     
  8.     Copyright:    © 1996 by Apple Computer, Inc., all rights reserved.
  9.     
  10.     Change History (most recent first):
  11.     
  12.             03/29/96            CW        First release
  13.  
  14. */
  15.  
  16.  
  17.  
  18. #ifndef __SCROLLBARS__
  19. #define __SCROLLBARS__
  20.  
  21.  
  22.  
  23. enum
  24. {
  25.     // Misc scroll bar constants
  26.  
  27.     kScrollBarWidth = 16,
  28.     kScrollBarWidthAdjust = kScrollBarWidth - 1,
  29.     
  30.     kScrollArrowWidth = 16,
  31.     kScrollThumbWidth = 16,
  32.     kTotalWidthAdjust = (kScrollArrowWidth * 2) + kScrollThumbWidth,
  33.     
  34.     kPageOverlap = 10,
  35.     kThumbTrackWidthSlop = 25,
  36.     kThumbTrackLengthSlop = 113
  37.  
  38. };
  39.  
  40.  
  41.  
  42.  
  43.  
  44.  
  45. typedef    pascal void (*IndicatorActionProc)(void);
  46.  
  47. #if GENERATINGCFM
  48. typedef UniversalProcPtr IndicatorActionUPP;
  49. #else
  50. typedef IndicatorActionProc IndicatorActionUPP;
  51. #endif
  52.  
  53. enum
  54. {
  55.     uppIndicatorActionProcInfo = kPascalStackBased
  56. };
  57.  
  58. #if GENERATINGCFM
  59. #define NewIndicatorActionProc(userRoutine)        \
  60.         (IndicatorActionUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppIndicatorActionProcInfo, GetCurrentArchitecture())
  61. #else
  62. #define NewIndicatorActionProc(userRoutine)        \
  63.         ((IndicatorActionUPP) (userRoutine))
  64. #endif
  65.  
  66. #if GENERATINGCFM
  67. #define CallIndicatorActionProc(userRoutine)    \
  68.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppIndicatorActionProcInfo)
  69. #else
  70. #define CallIndicatorActionProc(userRoutine)    \
  71.         (*(userRoutine))()
  72. #endif
  73.  
  74.  
  75.  
  76.  
  77.  
  78. #endif    // __SCROLLBARS__
  79.  
  80.